Write a custom CUDA kernel to optimize `RMAF` (ReLU-Memristor-like Activation Function).

Formula: f(x) = alpha * x / (0.25 * (1 + exp(-x)) + 0.75)^p

Problem Analysis:
1. Computationally Intensive & Memory Bound: The operation involves a chain of `exp`, `fma`, `pow`, `div`, and `mul`.
2. Operator Chaining: A PyTorch implementation creates multiple intermediate tensors.

Optimization Strategy: Fused Element-wise Kernel with Vectorization

1. One-Thread-per-Element: Map each element to a CUDA thread.

2. Vectorized Loads (float4): Use `float4` to process 128 bits per memory transaction.

3. Fused In-Register Math:
   - For each element `x`:
     `inner_exp = 1.0f + __expf(-x)`
     `denom = __powf(0.25f * inner_exp + 0.75f, p)`
     `result = alpha * x / denom`
   - All computations are fused in registers.

4. One-Pass: Fuse all steps into a single read-compute-write kernel.
  
Here's an example to show you the syntax of inline embedding custom CUDA operators in torch: The example given architecture is:   
  
```python
import torch
import torch.nn as nn

BATCH_SIZE = 4096
HIDDEN_DIM = 4096
SHAPE = (BATCH_SIZE, HIDDEN_DIM)

ALPHA_VAL = 1.0
P_VAL = 1.0

class RMAF(nn.Module):
    '''
    "RMAF: Relu-Memristor-Like Activation Function for Deep Learning" (IEEE Access, 2020)
    doi:10.1109/access.2020.2987829
    Formula: f(x) = alpha * x / (0.25 * (1 + exp(-x)) + 0.75)^p
    '''
    def __init__(self, alpha=1.0, p=1.0):
        super(RMAF, self).__init__()
        self.alpha = alpha
        self.p = p

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        inner_exp = 1.0 + torch.exp(-x)
        denominator = torch.pow(0.25 * inner_exp + 0.75, self.p)
        return self.alpha * x / denominator

class Model(nn.Module):
    def __init__(self, alpha=1.0, p=1.0):
        super(Model, self).__init__()
        self.act = RMAF(alpha, p)
    
    def forward(self, x):
        return self.act(x)

def get_inputs():
    input_tensor = torch.randn(SHAPE, dtype=torch.float32) * 5.0
    return [input_tensor.contiguous()]

def get_init_inputs():
    return [ALPHA_VAL, P_VAL]